<?php
//个人测试号
$appid = 'wxd17a3baf67b5eb59';
$secret = '53493ffae58f62fe215cc3925ccb57eb';
//xb测试号
// $appid = 'wx5788137027e155d5';
// $appsecret = '6a3a12f21af7e6770169e2cdb511f482';
$rurl = 'http://wx.alisleepy.top/userinfo/getuserinfo.php';

$url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid='.$appid.'&redirect_uri='.urlencode($rurl). '&response_type=code&scope=snsapi_userinfo&state=state#wechat_redirect';
header('location:' . $url);